package com.cindata

import grails.converters.JSON
import org.springframework.security.access.annotation.Secured

import grails.transaction.Transactional

@Secured(['permitAll'])
@Transactional
class CommonUtilsController
{

    static allowedMethods = [save: "POST", update: "PUT", delete: "DELETE"]

    def getAreaByParentNumber()
    {
        render([list: Area.findAllByParentArea(Area.findByZoneNumber(params['zoneNumber']))] as JSON)
    }

    def getAreaByParentId()
    {
        render([list: Area.findAllByParentArea(Area.findById(params['parentId']))] as JSON)
    }
}
